<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:t="http://myfaces.apache.org/tomahawk">
    
    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="Creacion de Productos"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form enctype="multipart/form-data">
                <h:panelGrid columns="2">
                   
                    <h:outputLabel value="Identificacion del Producto" for="productidproduct" />
                    <h:inputText id="productidproduct" value="#{productController.selected.productidproduct}" title="#{bundle.CreateProductTitle_productidproduct}" required="true" requiredMessage="#{bundle.CreateProductRequiredMessage_productidproduct}"/>
                    <h:outputLabel value="Nombre" for="productname" />
                    <h:inputText id="productname" value="#{productController.selected.productname}" title="#{bundle.CreateProductTitle_productname}" required="true" requiredMessage="#{bundle.CreateProductRequiredMessage_productname}"/>
                    <h:outputLabel value="Descripcion" for="productdescription" />
                    <h:inputText id="productdescription" value="#{productController.selected.productdescription}" title="#{bundle.CreateProductTitle_productdescription}" required="true" requiredMessage="#{bundle.CreateProductRequiredMessage_productdescription}"/>
                    
                    
                    
                    <h:outputLabel value="Categoria" for="productcategory" />
                    <h:selectOneMenu id="productcategory" value="#{productController.selected.productcategory}" title="Tipo de Tarjeta" >
                        <f:selectItems value="#{caregoryController.itemsAvailableSelectAllDb}"/>
                    </h:selectOneMenu>
                    
                    
                    <h:outputLabel value="Precio" for="productlistPrice" />
                    <h:inputText id="productlistPrice" value="#{productController.selected.productlistPrice}" title="#{bundle.CreateProductTitle_productlistPrice}" />
                    <h:outputLabel value="Producer" for="productproducer" />
                    <h:inputText id="productproducer" value="#{productController.selected.productproducer}" title="#{bundle.CreateProductTitle_productproducer}" />
                    <h:outputLabel value="Imagen" for="productimage" />
                    
     
                    <t:inputFileUpload id="file" value="#{productController.uploadedFile}" required="true" title="Ubicacion de la Imagen"/>
                   
                    
                    <h:outputLabel value="" for="productimageurl" />
                    <h:inputHidden id="productimageurl" value="#{productController.selected.productimageurl}" />
                    <h:outputLabel value="" for="productenable" />
                    <h:inputHidden id="productenable" value="#{productController.selected.productenable}" />
                </h:panelGrid>
                <br />
                <h:commandLink action="#{productController.create}" value="Crear" />
                <br />
                <br />
                <h:commandLink action="#{productController.prepareList}" value="Ver Productos" immediate="true"/>
                <br />
                <br />
                <h:commandLink value="Menu Principal" action="/index" immediate="true" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
